<template>
  <transition name="slide">
    <div class="list">
      <van-nav-bar title="校园招聘" leftText="返回" rightText="1" leftArrow @click-left="onClickLeft" @click-right="onClickRight" />
      <!-- <div class="scroll-wrapper" :ref="scroll-wrapper">
        <cube-scroll ref="scroll" :data="items" :options="options" @pulling-up="onPullingUp" @pulling-down="onPullingDown"></cube-scroll>
      </div> -->
      
      <!-- <ul class="itemWrap">
        <h2>课题：<span>{{ articleList.title }}</span></h2>
        <li class="item">
          <div class="Limg">
            <img v-if="articleList.reporterpic" :src="'http://meeting.xidian.edu.cn/uploads/images/'+articleList.reporterpic" alt="">
            <img v-if="!articleList.reporterpic" src="../../assets/img/xidian.jpg" alt="">
          </div>
          <div class="Rmsg">
            <h3 class="title">{{articleList.title}}</h3>
            <p class="reporter">主讲人：{{articleList.reporter}}</p>
            <p class="time">讲座时间：{{articleList.time}}</p>
            <p class="place">地点：{{ articleList.place}}</p>
          </div>
        </li>
        <p class="article">{{articleList.content }}</p>
      </ul> -->
      <div id="jobContent"></div>
      <!-- <router-view></router-view> -->
    </div>
  </transition>
</template>

<script>
import store from "../../common/store";
export default {
  data (){
    return {
      articleId:0,
      articleList:{}
    }
  },
  methods:{
    onClickLeft () {
      this.$router.go(-1)
      this.$router.beforeEach((to, from, next) => {
        const toDepth = to.path.split('/').length
        const fromDepth = from.path.split('/').length
        if (toDepth < fromDepth) {
          console.log('后退。。。')
          from.meta.keepAlive = false
          to.meta.keepAlive = true
        }
        next()
      })
    },
    onClickRight () {
      this.$router.push('/login/mint-pull')
    }
  },
  created (){
    this.articleId = this.$route.query.jobArticleId
    console.log(this.articleId)
    console.log(store.state.accesskey)
    this.$apis.getJobArticle(this.$route.query.jobArticleId,store.state.accesskey).then(res =>{
      console.log(res)
      let content = res.msg[0][2]
      console.log(content)
      let doc = document.getElementById('jobContent')
      doc.innerHTML = content
    })
    // this.$apis.getArticle(this.$route.query.jobArticleId).then(res => {
      // this.articleList = res.msg[0]
      // console.log(this.articleList);
      // this.articleList.content = this.articleList.content.split('>')[1].split('<')[0]
    // })
  },
  watch:{
    articleId:{
      handler:function(val,oldval){  
        console.log(oldval,val)  
      },  
      deep:true//对象内部的属性监听，也叫深度监听  
    },
    
  }
}
</script>


<style lang="less">
@import  "../../assets/less/baseDetail.less";
#jobContent{
  padding: 15px;
  height: calc(~'100% - 46px');
  overflow: scroll;
  font-size: 12px;
  line-height:35px;
  text-indent: 2em;
  p, li ,strong{
    font-size: 12px;
    line-height:35px;
    text-indent: 2em;
  }
}

</style>
<style lang="less" scoped>

</style>
